using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BossTrigger : MonoBehaviour
{
    private int num = 0;
    public GameObject boss;
    public Transform point;
    public GameObject bossGround;

    private void Start()
    {
        bossGround.SetActive(false);
    }

    private void OnTriggerEnter2D(Collider2D other)
    {
        if(other.tag == "Player")
        {
            num++;
        }
        if(num == 1)
        {
            bossGround.SetActive(true);
            GameObject temp = Resources.Load<GameObject>("Prefabs/Boss");
            boss = Instantiate(temp,point.position,Quaternion.identity);
            Camera cam = Camera.main;
            cam.gameObject.GetComponent<CameraMove>().BossCamera();
            Destroy(gameObject);
        }
    }

}
